Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

find-root

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

find-root

find the closest package.json

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10M
decreased by-6.35%
Maintainers
1
Weekly downloads
 
Created

What is find-root?

The find-root npm package is used to find the root directory of a Node.js project or module. This is typically the location where the 'package.json' file is located. It is useful when you have a deeply nested file structure and need to programmatically find the path to the project root.

What are find-root's main functionalities?

Find project root

This feature allows you to find the nearest directory containing a package.json file, which is considered the project's root directory.

const findRoot = require('find-root');
const root = findRoot('/path/to/some/deeply/nested/file');
console.log(root); // prints the path to the nearest directory containing a package.json

Other packages similar to find-root

Keywords

FAQs

Package last updated on 29 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc